<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
    <head>
        <title></title>

        <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
        <meta http-equiv="description" content="this is my page">
        <meta http-equiv="content-type" content="text/html; charset=utf-8">
        <meta name="viewport"
              content="width=device-width, initial-scale=1.0, minimum-scale=0.5, maximum-scale=2.0, user-scalable=yes" />
        <link rel="stylesheet" type="text/css" href="../css/style.css">
        <link rel="stylesheet" type="text/css" href="../css/all.css">
        <link rel="stylesheet" href="../css/common.css" type="text/css" />
        <link rel="stylesheet" type="text/css" href="../js/showDialog.css">
        <script type="text/javascript" src="../js/jquery.js">

        </script>
        <script type="text/javascript" src="../js/leqi.js">

        </script>
        <script type="text/javascript" src="../js/comment.js">

        </script>
        <script type="text/javascript" src="../js/showDialog.js">

        </script>
        <script type="text/javascript" src="../js/jquery.cookie.js"></script>
        <script type="text/javascript" src="../js/xheditor.js"></script>

        <script type="text/javascript">
            var type;
            var id;
            var recommentCount;//评论数
            $(document).ready(function() {
                setContent2IdByUrl(httpURL + "/header.html", "header");
                setContent2IdByUrl(httpURL + "/bottom.html", "bottom_page");
                //setHeader(httpURL+"/header.html");
                $("#email").val("");
                $("#username").val("");
                $("#message").val("");
               // type = GetQueryString("type");
                id = GetQueryString("id");
                // var title = GetQueryString("title");
                if (id == null) {
                    window.location.href = httpURL + "/index.html";
                    return;
                }
                getComment();
                $.ajax({
                    url: httpURL + "/edit/content!getContentInfo.do",
                    data: "id=" + id,
                    dataType: "json",
                    type: "POST",
                    success: function(msg) {
                        if (msg.msg != "error") {
                            $("#title").html("<center><h3>" + msg.title + "</h3></center>");
                            if (msg.fromwhere != null && msg.fromwhere.length > 0) {
                                $("#information").html("<center>文章转载自：" + msg.fromwhere + "</center>");
                            }
                            $("#content").html(msg.content);
                            upnextPage(msg.id);
                            updateReader(msg.reader + 1);
                        }
                    },
                    error: function() {
                    }
                });

            });

            function updateReader(reader) {
                $.ajax({
                    url: httpURL + "/edit/content!updateReader.do",
                    data: "id=" + id + "&reCommentId=" + reader,
                    type: "POST",
                    dataType: "json",
                    success: function(msg) {
                        //alert(msg.msg);
                    }
                });
            }



            function upnextPage(id) {
                $.ajax({
                    url: httpURL + "/edit/content!getContentNextUp.do",
                    data: "id=" + id + "&type=" + type,
                    dataType: "json",
                    type: "POST",
                    success: function(msg) {
                        //alert(msg);
                        if (msg.per == 1) {
                            $("#per").html("<a href='#' onclick='gotoNewPage(" + msg.perobj.id + ");return false;'>&lt;&lt;" + msg.perobj.title + "</a>");
                        } else {
                            $("#per").html("没有了");
                        }

                        if (msg.next == 1) {
                            $("#next").html("<a href='#' onclick='gotoNewPage(" + msg.nextobj.id + ");return false;'>" + msg.nextobj.title + "&gt;&gt;</a>");
                        } else {
                            $("#next").html("没有了");
                        }
                    },
                    error: function() {
                    }
                });
            }

            function gotoNewPage(id) {
                window.location.href = httpURL + "/content/readContent.html?type=" + type + "&id=" + id;
            }
        </script>
        <!-- 将此代码放在适当的位置，建议在body结束前 -->
        <script id="bdimgshare_shell"></script>
        <script>
            var bdShare_config_imgshare = {
                "type": "list"
                , "size": "small"
                , "pos": "top"
                , "color": "black"
                , "list": ["qzone", "tsina", "tqq", "renren", "t163"]
                , "uid": "1051393"
            };
            document.getElementById("bdimgshare_shell").src = "http://bdimg.share.baidu.com/static/js/imgshare_shell.js?cdnversion=" + Math.ceil(new Date() / 3600000);
        </script>

        <style>
            .showRightOverFlow {
                width: 300px;
                height: 300px;
                position: absolute;
                right: 22px;
                bottom: 20px;
                border: solid 1px #432B6A;
                z-index: 99999;
                background: #ffffff;
                display: none;
            }
        </style>
    </head>

    <body>
        <table style="width:100%;height:100%;table-layout: fixed;">
            <tr>
                <td style="width:15%;height:100%">
                    <!-- left -->
                </td>
                <td style="width:70%;height:100%">
                    <!-- middle -->
                    <table style="table-layout: fixed;">
                        <tr>
                            <td id="header"></td>
                        </tr>
                        <tr>
                            <td>
                                <div class="readcontenttable">
                                    <div >
                                        <span id="title" ></span>
                                    </div>
                                    <div>
                                        <span id="information" >

                                        </span>
                                    </div>
                                    <div>
                                        <span id="content" style="font-size:16px">

                                        </span>
                                    </div>
                                </div>
                                
                                    <div class="bdsharebuttonbox">
                                        <a href="#" class="bds_more" data-cmd="more"></a><a href="#"
                                                                                            class="bds_qzone" data-cmd="qzone"></a><a href="#"
                                                                                  class="bds_tsina" data-cmd="tsina"></a><a href="#"
                                                                                  class="bds_tqq" data-cmd="tqq"></a><a href="#"
                                                                              class="bds_renren" data-cmd="renren"></a><a href="#"
                                                                                    class="bds_weixin" data-cmd="weixin"></a>
                                    </div> <script>
                                        window._bd_share_config = {"common": {"bdSnsKey": {}, "bdText": "", "bdMini": "2", "bdPic": "", "bdStyle": "0", "bdSize": "16"}, "share": {}, "image": {"viewList": ["qzone", "tsina", "tqq", "renren", "weixin"], "viewText": "分享到：", "viewSize": "16"}, "selectShare": {"bdContainerClass": null, "bdSelectMiniList": ["qzone", "tsina", "tqq", "renren", "weixin"]}};
                                        with (document)
                                            0[(getElementsByTagName('head')[0] || body).appendChild(createElement('script')).src = 'http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion=' + ~(-new Date() / 36e5)];
                                    </script>

                                <!-- header -->
                                
                                <div style="width:100%">
                                    <table style="width:100% ;table-layout: fixed;font-size:12px">
                                        <tr>
                                            <td align="left" id="per"></td>
                                            <td align="right" id="next"></td>
                                        </tr>
                                    </table>
                                </div>
                            </td>

                        </tr>

                        <tr>
                            <td id="body">
                                <table style="width:100%">
                                    <tr>
                                        <td id="comment"></td>
                                    </tr>
                                </table>
                                <div class="page_nav" id="pages"></div>
                                <table id="editComment" style="width:70%">
                                    <tr>
                                        <td id="maodian">电子邮箱：</td>
                                        <td align="left"><input type="text" style="width:300px"
                                                                id="email" /></td>
                                    </tr>
                                    <tr>
                                        <td>昵称：</td>
                                        <td align="left"><input type="text" style="width:300px"
                                                                id="username" /></td>
                                    </tr>
                                    <tr>
                                        <td colspan="2"><textarea id="messageComment" rows="12"
                                                                  cols="80" style="width: 100%">
                                            </textarea></td>

                                    </tr>
                                    <tr>
                                        <td colspan="2"><input style="width:100px" type="button"
                                                               onclick="addComment(-1)" value="提交" />
                                        </td>

                                    </tr>
                                </table>
                            </td>
                        </tr>

                        <tr>
                            <td id="bottom_page"></td>
                        </tr>
                    </table>
                </td>

                <td style="width:15%;height:100%">
                    <!-- right -->
                </td>
            </tr>
        </table>

        <div id="dialog" class="showRightOverFlow"></div>
    </body>
</html>
